<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML>
<html>
  <head>
    <title>page</title>
    <script type="text/javascript">
		function gotoPage(pageNum){
			$("#pageForm").append("<input type=\"hidden\" name=\"pageNumber\" value=\"" + pageNum + "\"/>");
			$("#pageForm").append("<input type=\"hidden\" name=\"pageSize\" value=\"" + $("#pageSize").val() + "\"/>");
			$("#pageForm").submit(); // 提交表单
		}
	</script>
  </head>
  <body>
  	<c:if test="${ page.total > 0}">
  		<p>&nbsp;</p>
  		<p>&nbsp;</p>
	    <aside class="paging" style="position:fixed;right:20px;bottom:70px;">
	    	<a>共${page.totalPages }页 ${page.total }条</a>
	       	<a onclick="gotoPage(1);">第一页</a>
	    	<c:forEach begin="${page.beginPageNumber }" end="${page.endPageNumber}" var="num">
	    		<a onclick="gotoPage(${num});" <c:if test="${num == page.pageNumber }">style="background:white;color: #19a97b;"</c:if>>${num}</a>
	    	</c:forEach>
	       	<a onclick="gotoPage(${page.totalPages});">最后一页</a>
	       	<select id="pageSize" name="pageSize" onchange="gotoPage(1);">
	       		<option <c:if test="${20 == page.pageSize }">selected</c:if> value="20">每页20条</option>
	       		<option <c:if test="${50 == page.pageSize }">selected</c:if> value="50">每页50条</option>
	       		<option <c:if test="${100 == page.pageSize }">selected</c:if> value="100">每页100条</option>
	       		<option <c:if test="${500 == page.pageSize }">selected</c:if> value="500">每页500条</option>
	       		<option <c:if test="${1000 == page.pageSize }">selected</c:if> value="1000">每页1000条</option>
	       	</select>
	      </aside>
	  </c:if>
  </body>
</html>

